<?php
//sprintf — 返回格式化字符串
//sprintf(string $format, mixed ...$values): string

$num=5;
$location='tree';
$format='Three are %d monkeys in the %s';
echo sprintf($format,$num,$location);